package com.yoga.app.web;

import com.yoga.app.annotation.LoginUser;
import com.yoga.common.appexception.AppErrorCodeEnum;
import com.yoga.common.appexception.AppException;
import com.yoga.common.appexception.YogaResult;
import com.yoga.common.bo.YogaAdminBO;
import com.yoga.common.bo.YogaShopBO;
import com.yoga.common.page.PageBO;
import com.yoga.common.qto.YogaShopQTO;
import com.yoga.manager.admin.AdminYogaShopManager;
import com.yoga.manager.app.AppYogaShopManager;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * Created by hdx on 2020/10/20.
 */
@RestController
@RequestMapping("${basePath}")
public class AppYogaShopController {

    @Resource
    private AppYogaShopManager yogaShopManager;


    @PostMapping("/shop/findForPage")
    public YogaResult<PageBO<YogaShopBO>> findForPage(@LoginUser YogaAdminBO adminBO, YogaShopQTO yogaShopQTO) throws AppException {
        PageBO<YogaShopBO> result = yogaShopManager.findForPage(yogaShopQTO);

        return new YogaResult<>(result);
    }
}
